﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using LOMM3API;
using System.Collections.ObjectModel;

namespace LOMM3Shell
{
    public class SplashEvent
    {
        public BitmapImage  Icon        {get; set;}
        public String       Game        {get; set;}
        public String       Description {get; set;}
        public DateTime     Timestamp   {get; set;}
        
        public String       FormattedTime {get {return (Timestamp == null) ? null : Timestamp.ToString("hh:mm:ss");} protected set {}}

        public SplashEvent() {}
        public SplashEvent(LOMMGame game, String description)
        {
            Game        = game.Name;
            Icon        = game.Icon;
            Timestamp   = DateTime.Now;
            Description = description;
        }
    }
    public class SplashEventsList : ObservableCollection<SplashEvent> {}

    public partial class WindowSplash : Window
    {
        private SplashEventsList SplashEvents = new SplashEventsList();
        public WindowSplash()
        {   //=================================================================
            InitializeComponent();
            BitmapImage bmi = new BitmapImage(new Uri(@"C:\Dev\art\famfamfam_flag_icons\png\ch.png"));
            SplashEvents.Add(new SplashEvent() {Icon = bmi, Game = "Init test", Description = "Init test Description", Timestamp = DateTime.Now});
            lstEvents.ItemsSource = SplashEvents;
                       
            return;
        }

        public void AddEvent(SplashEvent ev)
        {   //=================================================================
            SplashEvents.Add(ev);
            return;
        }
    }
}
